package com.example.edupublisher.service.imp;

import com.example.edupublisher.bean.*;
import com.example.edupublisher.mapper.TrafficChannelStatsMapper;
import com.example.edupublisher.service.TrafficChannelStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName: TrafficChannelStatsServiceImpl
 * Package: com.atguigu.edu.publisher.service.impl
 * Description:
 *
 * @Author Mr.2
 * @Create 2023/9/9 15:56
 * @Version 1.0
 */
@Service
public class TrafficChannelStatsServiceImpl implements TrafficChannelStatsService {
    // 自动装载Mapper接口实现类
    @Autowired
    TrafficChannelStatsMapper trafficChannelStatsMapper;

    // 1. 获取 各渠道独立访客数
    @Override
    public List<TrafficUvCt> getUvCt(Integer date) {
        return trafficChannelStatsMapper.selectUvCt(date);
    }

    // 2. 获取 各渠道会话数
    @Override
    public List<TrafficSvCt> getSvCt(Integer date) {
        return trafficChannelStatsMapper.selectSvCt(date);
    }

    // 3. 获取 各渠道会话平均页面浏览数
    @Override
    public List<TrafficPvPerSession> getPvPerSession(Integer date) {
        return trafficChannelStatsMapper.selectPvPerSession(date);
    }

    // 4. 获取 各渠道会话平均页面访问时长
    @Override
    public List<TrafficDurPerSession> getDurPerSession(Integer date) {
        return trafficChannelStatsMapper.selectDurPerSession(date);
    }

    // 5. 获取 各渠道 跳出率
    @Override
    public List<TrafficUjRate> getUjRate(Integer date) {
        return trafficChannelStatsMapper.selectUjRate(date);
    }

}
